package me.sdau.spider.manager.common.entity.bo;

import com.google.common.collect.Lists;
import lombok.AllArgsConstructor;
import lombok.Builder;
import lombok.Data;
import lombok.NoArgsConstructor;
import me.sdau.spider.manager.modules.system.entity.Menu;

import java.util.List;
import java.util.Objects;
import java.util.stream.Collectors;

/**
 * @author zj
 * @date 2018/4/10 14:13
 */
@Data
@Builder
@NoArgsConstructor
@AllArgsConstructor
public class Tree<T> {
    /**
     * 节点 ID
     */
    private Long id;
    /**
     * 节点文本
     */
    private String text;
    /**
     * 节点状态，open closed
     */
    private Byte state;
    /**
     * 节点是否被选中 true false
     */
    private boolean checked = false;
    /**
     * 节点属性
     */
    private String href;
    private String icon;
    /**
     * 节点的子节点
     */
    private List<Tree<T>> children = Lists.newArrayList();

    /**
     * 是否有父节点
     */
    private boolean hasParent = false;
    /**
     * 父节点ID
     */
    private Long parentId;
    /**
     * 是否有父节点
     */
    private boolean hasChildren = false;
}
